package common;

import server.ChatThread;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.concurrent.CyclicBarrier;

//当前用户信息
public class NowUser {
//    private static final long serialVersionUID = 6L;//序列化
    public static ChatThread chatThread;
    public static User user;
    public static User friend;
    public static Group group;
    public static Socket socket;
    public static Communication communication;
    public static ObjectInputStream ois;
    public static ObjectOutputStream oos;
    public static CyclicBarrier cyclicBarrier;
    public static ArrayList<User> friendlist;
    public static ArrayList<Group> groupslist;
    public static ArrayList<Group> othergrouplist;
    public static ArrayList<Information> friendinformationlist;
    public static ArrayList<Information> groupinformationlist;
    public static boolean existfriend;//判断好友是否存在
    public static int friendrelation;//加好友时判断用户和好友关系
    public static boolean addfriend;//加好友
    public static int grouprelation;//加群时判断用户和群关系
    public static boolean acfriendinfo;//同意好友
    public static boolean rjfriendinfo;//拒绝好友
    public static boolean changeinfomation;//修改信息
    public static boolean existemail;//邮箱是否存在
    public static boolean changepsw;//修改密码
    public static boolean creatgroup;//创建群聊
    public static boolean deletefriend;//删除好友
    public static boolean dissolutiongroup;//解散群聊
    public static boolean exitgroup;//退出群聊
    public static boolean acceptgroup;//同意加入群聊
    public static boolean refusegroup;//拒绝加入群聊
    public static boolean chatsend;//发送消息请求
    public static boolean groupowner;//判断是否是群管理
    public static boolean changegroupinformation;//修改群资料
    public static boolean sendphoto;//上传图片
    public static ArrayList<Communication> friendchatlist;//私聊记录
    public static ArrayList<Communication> groupchatlist;//群聊记录
    public static ArrayList<Group> groupmemberstatement;//群成员状态
    public static ArrayList<User> groupmembers;//群成员信息

    public static ArrayList<Group> getGroupmemberstatement() {
        return groupmemberstatement;
    }
    public static void setGroupmemberstatement(ArrayList<Group> groupmemberstatement) {
        NowUser.groupmemberstatement = groupmemberstatement;
    }

    public static ArrayList<User> getGroupmembers() {
        return groupmembers;
    }
    public static void setGroupmembers(ArrayList<User> groupmembers) {
        NowUser.groupmembers = groupmembers;
    }

    public static int getFriendrelation() {
        return friendrelation;
    }
    public static void setFriendrelation(int friendrelation) {
        NowUser.friendrelation = friendrelation;
    }

    public static boolean isExistfriend() {
        return existfriend;
    }
    public static void setExistfriend(boolean existfriend) {
        NowUser.existfriend = existfriend;
    }

    public static ArrayList<User> getFriendslist() {
        return friendlist;
    }
    public static void setFriendslist(ArrayList<User> friendslist) {
        NowUser.friendlist = friendslist;
    }

    public static ArrayList<Group> getGroupslist() {
        return groupslist;
    }
    public static void setGroupslist(ArrayList<Group> groupslist) {
        NowUser.groupslist = groupslist;
    }

    public static ArrayList<Group> getOthergroupslist() {
        return othergrouplist;
    }
    public static void setOthergroupslist(ArrayList<Group> othergroupslist) {
        NowUser.othergrouplist = othergroupslist;
    }

    public static ArrayList<Information> getFriendinformationlist() {
        return friendinformationlist;
    }
    public static void setFriendinformationlist(ArrayList<Information> friendinformationlist) {
        NowUser.friendinformationlist = friendinformationlist;
    }

    public static ArrayList<Information> getGroupinformationlist() {
        return groupinformationlist;
    }
    public static void setGroupinformationlist(ArrayList<Information> groupinformationlist) {
        NowUser.groupinformationlist = groupinformationlist;
    }

    public static User getUser() {
        return user;
    }
    public static void setUser(User user) {
        NowUser.user = user;
    }

    public static Group getGroup() {
        return group;
    }
    public static void setGroup(Group group) {
        NowUser.group = group;
    }

    public static Socket getSocket() {
        return socket;
    }
    public static void setSocket(Socket s) throws IOException {
        socket = s;
    }

    public static User getFriend() {
        return friend;
    }
    public static void setFriend(User friend) {
        NowUser.friend = friend;
    }
//
//    public static ObjectInputStream getOis() {
//        return ois;
//    }
//    public static void setOis(ObjectInputStream ois) {
//        NowUser.ois = ois;
//    }
//
//    public static ObjectOutputStream getOos() {
//        return oos;
//    }
//    public static void setOos(ObjectOutputStream oos) {
//        NowUser.oos = oos;
//    }
}
